package com.zk.manager.controller;

import com.zk.common.entity.R;
import com.zk.manager.client.UserClient;
import com.zk.manager.entity.Brand;
import com.zk.manager.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hbxfwf
 * @since 2023-05-14
 */
@RestController
@RequestMapping("/manager/brand")
public class BrandController {
	@Autowired
	private BrandService brandService;
	@Autowired
	private UserClient userClient;
	//1. 列表品牌
	@GetMapping("list")
	public R findAll(){
		List<Brand> list = brandService.list();
		return R.ok().data("list",list);
	}

	//2. 根据用户id查询用户
	@GetMapping("/user/findById/{id}")
	public R findById(@PathVariable String id){
		return userClient.findById(id);
	}

}
